package com.fancy.mobileschool.service;

import android.util.Log;

import com.fancy.mobileschool.entity.Course;
import com.fancy.mobileschool.util.GsonUtil;
import com.fancy.mobileschool.util.OKHttpUtil;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

/**
 * Created by Jackie on 2017/11/21.
 */

public class CourseService {

    private static final String baseUrl = "http://192.168.1.100:8081/course";

    private static final String baseUrl1 =  "http://120.78.197.155:8080/MobileSchool-chat/course";


    public List<Course> getMyGroupsForStudent(String myID) {
        List<Course> rs;
        String url = baseUrl + "/getMyGroupsForStu.do?myID=" + myID;
        rs = OKHttpBase.fromJsonListByGet(url, Course.class);
        return rs;
    }

    public List<Course> getMyGroupsForTeacher(String myID) {
        List<Course> rs;
        String url = baseUrl + "/getMyCourseForTea.do?myID=" + myID;
        rs = OKHttpBase.fromJsonListByGet(url, Course.class);
        return rs;
    }
}
